<div class="dux-tools">
  <div class="bread-head">表单管理 <span class="small">可以添加或者修改表单功能</span> </div>
  <br>
  <div class="tools-function clearfix">
    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__APP__/form/index"> 表单列表</a> </div>
    <?php if(model('user_group')->model_power('form','add')){ ?>
    <div class="button-group float-right"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 添加 <span class="downward"></span></a>
      <ul class="drop-menu pull-right">
        <li><a href="__APP__/form/add">添加表单</a></li>
      </ul>
    </div>
    <?php } ?>
  </div>
</div>
<div class="admin-main"> 
  <!--管理员列表-->
  <div class="panel dux-box">
    <div class="table-responsive">
      <table id="table" class="table table-hover ">
        <tbody>
          <tr>
            <th width="100">编号</th>
            <th width="*">表单</th>
            <th width="*">表单名</th>
            <th width="150">操作</th>
          </tr>
             <!--foreach:{$list $vo}-->
              <tr>
                <td>{$vo.id}</td>
                <td>{$vo.name}</td>
                <td>{$vo.table}</td>
                <td>
                <?php if(model('user_group')->model_power('form','field')){ ?>
                <a href="__URL__/field_list/id-{$vo.id}" class="button bg-blue button-small icon-th" title="字段管理"></a>
                <?php } ?>
                <?php if(model('user_group')->model_power('form','edit')){ ?>
                &nbsp;&nbsp;<a class="button bg-blue button-small icon-pencil" href="__URL__/edit/id-{$vo.id}" title="修改"></a>
                <?php } ?>
                <?php if(model('user_group')->model_power('form','del')){ ?>
                 &nbsp;&nbsp;<a class="button bg-red button-small icon-trash-o js-del" href="javascript:void(0);" onclick="del('{$vo.id}',this)" title="删除"></a>
                <?php } ?></td>
              </tr>
              <!--{/foreach}-->
        </tbody>
      </table>
    </div>
  </div>
</div>
<script>
//loadmenu();
//function loadmenu(){
//	var doc = window.parent.document;
//	$.get('__APP__/menu/form?load=1', function(result){
//           $(doc).contents().find("#nav").html(result);
//     });
//}
function form_in(url) {
	urldialog({
	title:'表单导入',
	url:url
	});
	loadmenu();
};
function out(id) {
	ajaxpost({
		name:'导出的文件将在网站目录下的"data/form"中，请自行下载！',
		url:"__URL__/out",
		data:{id:id},
		tip:1
	});
};
//删除
function del(id,obj) {
	var obj;
	ajaxpost({
		name:'删除模型后会同时删除模型表和内容! ',
		url:"__URL__/del",
		data:{id: id},
		tip:1,
		success:function(){
			$(obj).parent().parent().remove();
			loadmenu();
		}
	});
}
</script></div>
